package com.orilife.message;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.example.orllife.R;
import com.orilife.connectdata.GetPersonInfo;
import com.orilife.message.LogisticsMessageActivity;
import com.orilife.message.NewFriendsMessageActivity;
import com.orilife.message.CommentsMessageActivity;
import com.orilife.message.CircleNotifyMessageActivity;
import com.orilife.message.ZanMessageActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

public class MessageFragment extends Fragment implements OnClickListener {
	Button logisticButton, newFriendsButton, zanButton, remarkButton;
			
	@Override
	public View onCreateView(LayoutInflater inflater,
			@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View view = inflater.inflate(R.layout.messagelayout, null);
		logisticButton = (Button) view.findViewById(R.id.bylogisticsbt);
		newFriendsButton = (Button) view.findViewById(R.id.bynewfriendsbt);
		zanButton = (Button) view.findViewById(R.id.byzanbt);
		remarkButton = (Button) view.findViewById(R.id.bycommentsbt);
		
		logisticButton.setOnClickListener(this);
		newFriendsButton.setOnClickListener(this);
		zanButton.setOnClickListener(this);
		remarkButton.setOnClickListener(this);
		

		return view;
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		Intent intent = null;
		switch (v.getId()) {

		case R.id.bylogisticsbt:
			intent = new Intent(getActivity(), LogisticsMessageActivity.class);
			break;
		case R.id.bynewfriendsbt:
			intent = new Intent(getActivity(),NewFriendsMessageActivity.class);
			break;
		case R.id.byzanbt:
			intent = new Intent(getActivity(),ZanMessageActivity.class);
			break;
		case R.id.bycommentsbt:
			intent = new Intent(getActivity(),CommentsMessageActivity.class);
			break;
		
		}
		startActivity(intent);
	}

}
